<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{:t('会员')}等级背景设置</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
    <style>
    .layui-form-label{width:130px!important}
    #ggtable .layui-input{ display:inline;height:30px}
    #ggtable .layui-btn{ margin-top:-3px;margin-left:1px}
    </style>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
                <div class="layui-card-header">
                    <i class="fa fa-pencil"></i> 编辑{:t('会员')}等级背景设置
                    <i class="layui-icon layui-icon-close" style="font-size:18px;font-weight:bold;cursor:pointer" onclick="closeself()"></i>
                </div>
                <div class="layui-card-body" pad15>
                    <div class="layui-form" lay-filter="">
                        <input type="hidden" name="info[id]" value="{$info.id}"/>
                        <div class="layui-form-item">
                            <label class="layui-form-label">标题：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="info[title]" class="layui-input" value="{$info.title}" >
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">等级名称：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="info[level_name]" class="layui-input" value="{$info.level_name}" >
                            </div>
                        </div>
                        
                        <div class="layui-form-item">
                            <label class="layui-form-label">背景图片：</label>
                            <input type="text" name="info[bgimg]" id="bgimg" lay-verType="tips" class="layui-input" value="{$info.bgimg}" style="width: 300px;display: inline-block;float: left;">
                            <button style="float:left;" type="button" class="layui-btn layui-btn-primary" onclick="uploader(this)" upload-input="bgimg" upload-preview="bgimgPreview">上传图片</button>
                            <div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：750×400像素</div>
                            <div id="bgimgPreview" style="float:left;padding-top:10px;padding-left:160px;clear: both;">
                                <div class="layui-imgbox" style="width:50px;height:50px"><div class="layui-imgbox-img"><img src="{$info.bgimg}"/></div></div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" >背景颜色：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="info[bgcolor]" value="{$info['bgcolor']}" class="layui-input">
                            </div>
                            <div class="_colorpicker" style="float:left"></div>
                            <div class="layui-form-mid layui-word-aux" style="margin-left:10px;">如：#F2D8B2</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"></label>
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="formsubmit">提 交</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
  </div>
    {include file="public/js"/}
    <script>
    var ueditor = UE.getEditor('explain',{imageScaleEnabled:false});

    layui.form.on('submit(formsubmit)', function(obj){
        var field = obj.field
        var index = layer.load();
        $.post("{:url('bgset')}",obj.field,function(data){
            layer.close(index);
            dialog(data.msg,data.status);
            if(data.status == 1){
                setTimeout(function(){
                    parent.layer.closeAll();
                    parent.tableIns.reload()
                },1000)
            }
        })
    })
  </script>
    {include file="public/copyright"/}
</body>
</html>